import asyncio


async def fun1():
    print(1)
    await asyncio.sleep(2)
    return 'ok'


async def fun2():
    res = await fun1()
    print(res)


async def fun3():
    await asyncio.sleep(2)
    return 'start'


def callback(future):
    print(future.result())


if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    print(type(loop))
    tasks = []
    tasks.append(loop.create_task(fun2()))
    t = loop.create_task(fun3())
    t.add_done_callback(callback)
    tasks.append(t)

    core = asyncio.gather(*tasks)

    loop.run_until_complete(core)
    loop.close()
